$(function () {
    let res = myAjax("/common", {whereShow: 1}, "get");
    console.log(res);
    setCompanyData(res.companyDTO);
    setNavData(res.navDTO);
})

function setCompanyData(data) {
    $("#logo").attr("src", data.logo);
    $("#phone").html(data.phone);
    $("#net").html("网址: " + data.net);
    $("#email").html(" 邮箱:" + data.email + "联系电话: " + data.linePhone + "(座机)");
    $("#address").html("联系地址:" + data.address);
    $("#version").html(data.version);
}

function setNavData(data) {
    //java的写法： String str="";  str+=arr[i];
    let str = '';
    if (data == null) return;
    for (let i = 0; i < data.length; i++) {
        str += '<div onclick="window.location.href=\'' + data[i].href + '\'">' + data[i].title + '</div>';
    }
    $("#nav").html(str);
}
